package com.ruoyi.visit.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.visit.mapper.LetterVisitMapper;
import com.ruoyi.visit.domain.LetterVisit;
import com.ruoyi.visit.service.ILetterVisitService;

/**
 * 信访投诉Service业务层处理
 * 
 * @author yxf
 * @date 2021-08-22
 */
@Service
public class LetterVisitServiceImpl implements ILetterVisitService 
{
    @Autowired
    private LetterVisitMapper letterVisitMapper;

    /**
     * 查询信访投诉
     * 
     * @param lvId 信访投诉ID
     * @return 信访投诉
     */
    @Override
    public LetterVisit selectLetterVisitById(Long lvId)
    {
        return letterVisitMapper.selectLetterVisitById(lvId);
    }

    /**
     * 查询信访投诉列表
     * 
     * @param letterVisit 信访投诉
     * @return 信访投诉
     */
    @Override
    public List<LetterVisit> selectLetterVisitList(LetterVisit letterVisit)
    {
        return letterVisitMapper.selectLetterVisitList(letterVisit);
    }

    /**
     * 新增信访投诉
     * 
     * @param letterVisit 信访投诉
     * @return 结果
     */
    @Override
    public int insertLetterVisit(LetterVisit letterVisit)
    {
        letterVisit.setCreateTime(DateUtils.getNowDate());
        return letterVisitMapper.insertLetterVisit(letterVisit);
    }

    /**
     * 修改信访投诉
     * 
     * @param letterVisit 信访投诉
     * @return 结果
     */
    @Override
    public int updateLetterVisit(LetterVisit letterVisit)
    {
        letterVisit.setUpdateTime(DateUtils.getNowDate());
        return letterVisitMapper.updateLetterVisit(letterVisit);
    }

    /**
     * 批量删除信访投诉
     * 
     * @param lvIds 需要删除的信访投诉ID
     * @return 结果
     */
    @Override
    public int deleteLetterVisitByIds(Long[] lvIds)
    {
        return letterVisitMapper.deleteLetterVisitByIds(lvIds);
    }

    /**
     * 删除信访投诉信息
     * 
     * @param lvId 信访投诉ID
     * @return 结果
     */
    @Override
    public int deleteLetterVisitById(Long lvId)
    {
        return letterVisitMapper.deleteLetterVisitById(lvId);
    }
}
